package com.itboye.jigongbao.utils;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.itboye.jigongbao.R;


/**
 * 等待的旋转动画
 */
@SuppressLint("NewApi")
public class LoadingDialog extends DialogFragment {

    private String message = "Loading";

    public void setMsg(String msg) {
        this.message = msg;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        LayoutInflater inflater = getActivity().getLayoutInflater();
        View view = inflater.inflate(R.layout.dialog_loading, null);
        TextView title = view
                .findViewById(R.id.id_dialog_loading_msg);
//        ImageView queryPersonData=view.findViewById(R.id.queryPersonData);
//        XGlideLoader.displayResourceImage(getActivity(),R.drawable.jiazaizhong16,queryPersonData);
        title.setText(message);
        Dialog dialog = new Dialog(getActivity(), R.style.dialog);
        dialog.setContentView(view);
        dialog.setCanceledOnTouchOutside(false);

        return dialog;
    }
}
